package com.yao.club.reposittory;

import com.yao.club.entity.dto.PostsLikeRecord;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface PostsLikeRecordRepository extends JpaRepository<PostsLikeRecord, String> {


    @Query(nativeQuery=true,value="select * from posts_like_record where post_id = :post_id and user_id = :user_id")
    PostsLikeRecord findByPostIdAndUserId(@Param("post_id") Long post_id, @Param("user_id") String user_id);


}
